package com.lieve.mapper;

import com.lieve.entity.Blog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author sunlijiang
 * @date 2020/4/11
 */
//@Mapper
public interface BlogMapper {

    @Select("select id, title, content from blog where id = #{id} ")
    Blog getById(Long id);

    @Insert("insert into blog(id, title, content) values(#{id}, #{title}, #{content})")
    int save(Blog blog);

    @Update("update blog set title = #{title}, content = #{content} where id = #{id}")
    int update(Blog blog);
}
